import { request } from '@/utils/http'
// import qs from 'qs'

export function getBackLogApi (params) {
  return request({
    url: '/api/ticket/getBackLog',
    method: 'GET',
    params
  })
}
export function getSubmitterLogApi (params) {
  return request({
    url: '/api/ticket/getSubmitterLog',
    method: 'GET',
    params
  })
}

export function getTicketistApi (params) {
  return request({
    url: '/api/ticket/getTicketist',
    method: 'GET',
    params
  })
}

export function getTicketPageApi (params) {
  return request({
    url: '/api/ticket/getTicketPage',
    method: 'GET',
    params
  })
}

export function userListApi (params) {
  return request({
    url: '/api/user/userList',
    method: 'POST',
    data: params
  })
}

export function addTicketApi (params) {
  return request({
    url: '/api/ticket/add',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: params
  })
}
export function getOneApi (params) {
  return request({
    url: '/api/ticket/getOne',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    params
  })
}

export function ticketUpdateApi (params) {
  return request({
    url: '/api/ticket/update',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data:params
  })
}
export function workTypeApi (params) {
  return request({
    url: '/api/ticketConfig/typeList',
    method: 'GET',
    params
  })
}

export function homePageApi (params) {
  return request({
    url: '/api/hiddenDanger/submit',
    method: 'POST',
    // headers: {
    //   'Content-Type': 'application/json'
    // },
    params
  })
}

export function messageReminderApi (params) {
  return request({
    url: '/api/user/messageReminder',
    method: 'GET',
    params
  })
}

//修改后接口

export function addOrUpdateApi (params) {
  return request({
    url: '/api/ticket_info/addOrUpdate',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data:params
  })
}

export function pageSubmitApi (params) {
  return request({
    url: '/api/ticket_info/pageSubmit',
    method: 'GET',
    params
  })
}

export function pageApproveApi (params) {
  return request({
    url: '/api/ticket_info/pageApprove',
    method: 'GET',
    params
  })
}


export function getTicketDetailApi (params) {
  return request({
    url: '/api/ticket_info/getTicketDetail',
    method: 'GET',
    params
  })
}
export function approveApi (params) {
  return request({
    url: '/api/ticket_info/approve',
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data:params
  })
}